<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    离端午节放假剩下<span id="late">？天 ？小时 ？ 分钟 ？ 秒</span>
    <script>
        setInterval(function() {
            var now = new Date()
            var holiday = new Date('2020-6-24 21:00:00')
            var time = Math.abs(now.getTime() - holiday.getTime())
            // console.log(now, holiday, time)
            var d = parseInt(time / 1000 / 60 / 60 / 24)
            var h = parseInt(time / 1000 / 60 / 60 % 24)
            var m = parseInt(time / 1000 / 60 % 60)
            var s = parseInt(time / 1000 % 60)
            late.innerHTML = d + '天' + h + '小时' + m + '分钟' + s + '秒'
        }, 1000)
    </script>
</body>

</html>